package com.microcore.dao.mapper;

import com.microcore.entity.AssertCondition;
import org.apache.ibatis.jdbc.SQL;

public class AssertConditionSqlProvider {

    public String insertSelective(AssertCondition record) {
        SQL sql = new SQL();
        sql.INSERT_INTO("tb_ssgp_assert_condition");

        if (record.getAssertId() != null) {
            sql.VALUES("assert_id", "#{assertId,jdbcType=VARCHAR}");
        }

        if (record.getFkId() != null) {
            sql.VALUES("fk_id", "#{fkId,jdbcType=VARCHAR}");
        }

        if (record.getConditions() != null) {
            sql.VALUES("conditions", "#{conditions,jdbcType=VARCHAR}");
        }

        return sql.toString();
    }

    public String updateByPrimaryKeySelective(AssertCondition record) {
        SQL sql = new SQL();
        sql.UPDATE("tb_ssgp_assert_condition");

        if (record.getFkId() != null) {
            sql.SET("fk_id = #{fkId,jdbcType=VARCHAR}");
        }

        if (record.getConditions() != null) {
            sql.SET("conditions = #{conditions,jdbcType=VARCHAR}");
        }

        sql.WHERE("assert_id = #{assertId,jdbcType=VARCHAR}");

        return sql.toString();
    }
}
